package com.component.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.component.service.SysUserService;
import com.system.config.SpringContextUtils;
import lombok.Data;

/**
 * 
 * @TableName m_dicti
 */
@TableName(value ="m_dicti")
@Data
public class MDicti implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 
     */
    private String dictName;

    /**
     * 
     */
    private String dictKey;

    /**
     * 
     */
    private Integer level;

    /**
     * 
     */
    private Integer pid;

    /**
     * 
     */
    private String labelKey;

    /**
     * 
     */
    private String labelVal;

    /**
     * 
     */
    private String labelName;

    /**
     * 
     */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createdate;

    /**
     * 
     */
    private String userid;

    public SysUserEntity getUser() {
        if(this.userid!=null) {
            SysUserService sysUserService= SpringContextUtils.getBean(SysUserService.class);
            this.user=sysUserService.getById(this.userid);
            if(this.user != null){
                this.user.setPassword("");
            }
            return this.user;
        }
        return null;
    }

    @TableField(exist = false)
    private SysUserEntity user;



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}